package com.fypWebService;


// ------- IMPORTED PACKAGES --------------------------------------------




import javax.servlet.*;
import javax.servlet.http.*;

import java.net.*;
import java.io.*;   


// ------- IMPLEMENTATION -----------------------------------------------

/**
 * <STRONG>
 * Description:
 * </STRONG><BR>
 */

public class SMS extends HttpServlet
{
    public void init(ServletConfig config) throws ServletException
    {
       super.init(config);
    }

    public void doGet(HttpServletRequest request,
                      HttpServletResponse response)
        throws IOException, ServletException
    {
    }
    
    public void sendSMS(String Msg) throws Exception{
    	
    URL smsURL = new URL("http://www.smsxchange.com/scripts/sendsms.asp?phone=6590497848&sms="+Msg+"&userid=zhongcai&password=607945");
        URLConnection yc = smsURL.openConnection();
        BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
        String inputLine;
        while((inputLine=in.readLine())!=null){
            System.out.println(inputLine);
        }
        in.close();
    }

}






